/*
 * XWizardPage.java
 * 
 * Copyright (c) 2006 - 2007
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.xfc.wizard;

import java.awt.LayoutManager;

import javax.swing.JComponent;
import javax.swing.JPanel;

/**
 * 
 * 
 * @author Devon Carew
 */
public class XDefaultWizardPage
	extends JPanel
	implements XWizardPage
{
	private String 		title;
	private String 		description;
	
	private XWizardPage	nextPage;
	private boolean 	earlyFinishAllowed;
	
	private boolean 	validationError;
	private String 		validationMessage;
	
	
	public XDefaultWizardPage()
	{
		
	}
	
	public XDefaultWizardPage(LayoutManager layout)
	{
		super(layout);
	}
	
	
	public final JComponent getContent()
	{
		return this;
	}

	public String getTitle()
	{
		return title;
	}
	
	public void setTitle(String title)
	{
		String oldValue = this.title;
		this.title = title;
		firePropertyChange("title", oldValue, title);
	}
	
	public String getDescription()
	{
		return description;
	}

	public void setDescription(String description)
	{
		String oldValue = this.description;
		this.description = description;
		firePropertyChange("description", oldValue, description);
	}

	public XWizardPage getNextPage()
	{
		return nextPage;
	}
	
	public void setNextPage(XWizardPage nextPage)
	{
		XWizardPage oldValue = this.nextPage;
		this.nextPage = nextPage;
		firePropertyChange("nextPage", oldValue, nextPage);
	}
	
	public boolean isEarlyFinishAllowed()
	{
		return earlyFinishAllowed;
	}
	
	public void setEarlyFinishAllowed(boolean earlyFinishAllowed)
	{
		boolean oldValue = this.earlyFinishAllowed;
		this.earlyFinishAllowed = earlyFinishAllowed;
		firePropertyChange("earlyFinishAllowed", oldValue, earlyFinishAllowed);
	}
	
	public boolean hasValidationError()
	{
		return validationError;
	}
	
	public void setValidationError(boolean validationError)
	{
		boolean oldValue = this.validationError;
		this.validationError = validationError;
		firePropertyChange("validationError", oldValue, validationError);
	}
	
	public String getValidationMessage()
	{
		return validationMessage;
	}
	
	public void setValidationMessage(String validationMessage)
	{
		String oldValue = this.validationMessage;
		this.validationMessage = validationMessage;
		firePropertyChange("validationMessage", oldValue, validationMessage);
	}

}
